package com.mall.sun.controller;

import com.mall.sun.model.vo.ResultVO;
import com.mall.sun.service.UseradviceService;
import com.mall.sun.utils.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * description:  <br>
 * date: 2021/12/8 19:41 <br>
 * author: ztz <br>
 * version: 1.0 <br>
 */
@RestController
@RequestMapping("/advice")
public class UserAdviceController {
    @Autowired
    UseradviceService useradviceService;
    @GetMapping("/user/{userId}")
    public ResultVO getUserAdvice(@PathVariable Integer userId){
        return CommonUtil.ajaxReturn(useradviceService.getUserAdvice(userId));
    }
    @GetMapping("/order/{orderId}")
    public ResultVO getOrderAdvice(@PathVariable Integer orderId){
        return CommonUtil.ajaxReturn(useradviceService.getUserAdvice(orderId));
    }
    @GetMapping("/count")
    public ResultVO countAdvice(){
        return CommonUtil.ajaxReturn(useradviceService.countAdvice());
    }
}
